﻿package plugin.zbhsy
{
    import cmd.*;
    import com.core.*;
    import consts.*;
    import flash.events.*;
    import manager.*;
    import morn.core.components.*;
    import morn.core.handlers.*;
    import pluginfw.*;
    import pluginfw.nio.*;
    import uiresource.zbhsy.*;
    import view.uilt.*;

    public class ZbhsyCtrl extends ZbhsyUI
    {
        private var _instance:Zbhsy;
        private var txtarr:Array;
        private var djarr:Array;
        private var zsitem:Array;
        private var fsitem:Array;
        private var dsitem:Array;
        private var allarr:Array;
        private var fbzyarr:Array;
        private var _cfgRecycle:Object;
        private var ishf:Boolean;
        private var zszb1:Array;
        private var fszb1:Array;
        private var dszb1:Array;
        private var ksidarr:Array;
        private var ksarr:Array;

        public function ZbhsyCtrl(param1:Zbhsy)
        {
            this.txtarr = ["60级以下({0})", "60级装备({0})", "70级装备({0})", "80级装备({0})"];
            this.djarr = [60, 60, 70, 80];
            this.ksidarr = [240202014, 240202015, 240202016, 240202017];
            this._instance = param1;
            return;
        }// end function

        override protected function initializeView() : void
        {
            super.initializeView();
            var _loc_1:* = Control.create(ZhhsyControl, this);
            ModelProxy.addObserver("bag", _loc_1);
            closebtn.addEventListener(MouseEvent.CLICK, this.onClose);
            tstxt.text = "回收矿石可获得大量金币,\n回收装备可获得大量经验并有一定几率获得护盾碎片,\n全部回收不会自动回收高于自身等级的装备,\n<font color= \'#C72514\'>(强化过的装备不可回收)</font>";
            this.ishf = ModelProxy.getValue("data", "hefu");
            fbzbtxt.visible = false;
            kstxt.x = 80;
            zbtxt.x = 216;
            this.initEvent();
            this.hfhs();
            return;
        }// end function

        private function initEvent() : void
        {
            zslist.selectHandler = new Handler(this.clearZS);
            dslist.selectHandler = new Handler(this.clearDS);
            fslist.selectHandler = new Handler(this.clearFS);
            kstxt.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
            kstxt.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
            kstxt.addEventListener(MouseEvent.CLICK, this.clearKS);
            zbtxt.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
            zbtxt.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
            zbtxt.addEventListener(MouseEvent.CLICK, this.clearZb);
            zslist.renderHandler = new Handler(this.zslistHandler);
            fslist.renderHandler = new Handler(this.fslistHandler);
            dslist.renderHandler = new Handler(this.dslistHandler);
            return;
        }// end function

        protected function onClose(event:MouseEvent) : void
        {
            ModelProxy.change("plugin", "close", "zbhsy");
            ModelProxy.change("plugin", "close", "bag");
            return;
        }// end function

        public function init() : void
        {
            var _loc_11:Object = null;
            var _loc_12:Object = null;
            var _loc_13:int = 0;
            var _loc_14:Object = null;
            var _loc_15:Object = null;
            var _loc_1:* = UserData.getBagData();
            if (this._cfgRecycle == null)
            {
                this._cfgRecycle = ConfigDictionary.data.recycle;
            }
            var _loc_2:* = UserData.getUserData();
            this.allarr = [];
            this.dsitem = [];
            this.fsitem = [];
            this.zsitem = [];
            this.ksarr = [];
            var _loc_3:* = _loc_1.maxcount;
            var _loc_4:int = 0;
            var _loc_5:int = 0;
            var _loc_6:Number = 0;
            var _loc_7:int = 0;
            var _loc_8:int = 0;
            var _loc_9:int = 1;
            while (_loc_9 <= _loc_3)
            {
                
                if (_loc_1[_loc_9] && _loc_1[_loc_9][4] && _loc_1[_loc_9][4].itemtype == 1)
                {
                    _loc_12 = this._cfgRecycle[_loc_1[_loc_9][4].itemid];
                    if (_loc_12)
                    {
                        if (_loc_1[_loc_9][4].superlevel <= 0)
                        {
                            if (this.ishf)
                            {
                                this.allarr.push(_loc_1[_loc_9]);
                                _loc_4++;
                            }
                            else if (_loc_1[_loc_9][4].reinlv < 1)
                            {
                                this.allarr.push(_loc_1[_loc_9]);
                                _loc_4++;
                            }
                        }
                    }
                }
                _loc_9++;
            }
            var _loc_10:int = 0;
            while (_loc_10 < this.ksidarr.length)
            {
                
                _loc_13 = ItemUilt.getAllCount(this.ksidarr[_loc_10]);
                if (_loc_13 > 0)
                {
                    _loc_5 = _loc_5 + _loc_13;
                    _loc_14 = this._cfgRecycle[this.ksidarr[_loc_10]];
                    this.ksarr.push(_loc_14);
                    _loc_6 = _loc_6 + int(_loc_14.exp * _loc_13);
                    _loc_7 = _loc_7 + int(_loc_14.bgold * _loc_13);
                }
                _loc_10++;
            }
            if (_loc_5 <= 0)
            {
                kstxt.labelColors = "0x766b62";
                kstxt.label = "回收全部矿石(0)";
                kstxt.mouseEnabled = false;
            }
            else
            {
                kstxt.labelColors = "0x54B436,0xefd742,0x54b436,0xefd742";
                kstxt.label = "回收全部矿石(" + _loc_5 + ")";
                kstxt.mouseEnabled = true;
            }
            if (_loc_4 <= 0)
            {
                zbtxt.labelColors = "0x766b62";
                zbtxt.label = "回收全部装备(0)";
                zbtxt.mouseEnabled = false;
            }
            else
            {
                zbtxt.labelColors = "0x54B436,0xefd742,0x54b436,0xefd742";
                zbtxt.label = "回收全部装备(" + _loc_4 + ")";
                zbtxt.mouseEnabled = true;
            }
            this.zszb1 = [];
            this.fszb1 = [];
            this.dszb1 = [];
            for each (_loc_11 in this.allarr)
            {
                
                _loc_15 = this._cfgRecycle[_loc_11[4].itemid];
                if (_loc_15)
                {
                    _loc_6 = _loc_6 + int(_loc_15.exp);
                    _loc_7 = _loc_7 + int(_loc_15.bgold);
                }
                if (_loc_11[4].career == 1)
                {
                    if (_loc_11[4].reinlv == 1)
                    {
                        this.zszb1.push(_loc_15);
                    }
                    else
                    {
                        this.zsitem.push(_loc_11);
                    }
                    continue;
                }
                if (_loc_11[4].career == 2)
                {
                    if (_loc_11[4].reinlv == 1)
                    {
                        this.fszb1.push(_loc_15);
                    }
                    else
                    {
                        this.fsitem.push(_loc_11);
                    }
                    continue;
                }
                if (_loc_11[4].career == 3)
                {
                    if (_loc_11[4].reinlv == 1)
                    {
                        this.dszb1.push(_loc_15);
                        continue;
                    }
                    this.dsitem.push(_loc_11);
                }
            }
            if (this.ishf)
            {
                if (this.zszb1.length <= 0)
                {
                    zszhuan1.label = "1转装备 (0)";
                    zszhuan1.labelColors = "0x766b62";
                    zszhuan1.mouseEnabled = false;
                }
                else
                {
                    zszhuan1.label = "1转装备 (" + this.zszb1.length + ")";
                    zszhuan1.labelColors = "0x54B436,0xefd742,0x54b436,0xefd742";
                    zszhuan1.mouseEnabled = true;
                }
                if (this.fszb1.length <= 0)
                {
                    fszhuan1.label = "1转装备 (0)";
                    fszhuan1.labelColors = "0x766b62";
                    fszhuan1.mouseEnabled = false;
                }
                else
                {
                    fszhuan1.label = "1转装备 (" + this.fszb1.length + ")";
                    fszhuan1.labelColors = "0x54B436,0xefd742,0x54b436,0xefd742";
                    fszhuan1.mouseEnabled = true;
                }
                if (this.dszb1.length <= 0)
                {
                    dszhuan1.label = "1转装备 (0)";
                    dszhuan1.labelColors = "0x766b62";
                    dszhuan1.mouseEnabled = false;
                }
                else
                {
                    dszhuan1.label = "1转装备 (" + this.dszb1.length + ")";
                    dszhuan1.labelColors = "0x54B436,0xefd742,0x54b436,0xefd742";
                    dszhuan1.mouseEnabled = true;
                }
            }
            jytxt.text = "全部回收可得经验:" + _loc_6;
            goldtxt.text = "全部回收可得金币:" + _loc_7;
            zslist.array = this.txtarr;
            fslist.array = this.txtarr;
            dslist.array = this.txtarr;
            zslist.selectedIndex = -1;
            fslist.selectedIndex = -1;
            dslist.selectedIndex = -1;
            return;
        }// end function

        private function hfhs() : void
        {
            if (this.ishf)
            {
                var _loc_1:Boolean = true;
                dszhuan1.visible = true;
                var _loc_1:* = _loc_1;
                fszhuan1.visible = _loc_1;
                zszhuan1.visible = _loc_1;
                zszhuan1.label = "1转装备(0)";
                fszhuan1.label = "1转装备(0)";
                dszhuan1.label = "1转装备(0)";
                dszhuan1.addEventListener(MouseEvent.CLICK, this.zhuan1);
                fszhuan1.addEventListener(MouseEvent.CLICK, this.zhuan1);
                zszhuan1.addEventListener(MouseEvent.CLICK, this.zhuan1);
                zszhuan1.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
                dszhuan1.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
                fszhuan1.addEventListener(MouseEvent.ROLL_OVER, this.rollover);
                fszhuan1.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
                dszhuan1.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
                zszhuan1.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
            }
            else
            {
                var _loc_1:Boolean = false;
                dszhuan1.visible = false;
                var _loc_1:* = _loc_1;
                fszhuan1.visible = _loc_1;
                zszhuan1.visible = _loc_1;
            }
            return;
        }// end function

        protected function zhuan1(event:MouseEvent) : void
        {
            var _loc_3:int = 0;
            var _loc_2:* = event.currentTarget as LinkButton;
            switch(_loc_2)
            {
                case dszhuan1:
                {
                    _loc_3 = 3;
                    break;
                }
                case fszhuan1:
                {
                    _loc_3 = 2;
                    break;
                }
                case zszhuan1:
                {
                    _loc_3 = 1;
                    break;
                }
                default:
                {
                    break;
                }
            }
            var _loc_4:* = new Output();
            new Output().writeVarInt(0, false);
            _loc_4.writeVarInt(200, false);
            _loc_4.writeVarInt(_loc_3, false);
            _loc_4.writeVarInt(1, false);
            PluginManager.instance.sendToBufferServer("zbhsy", CMDRecycle.RecycleEquip, _loc_4);
            return;
        }// end function

        protected function clearKS(event:MouseEvent) : void
        {
            PluginManager.instance.sendToBufferServer("zbhsy", CMDRecycle.RecycleKS, new Output());
            return;
        }// end function

        private function clearFB(event:MouseEvent) : void
        {
            PluginManager.instance.sendToBufferServer("zbhsy", CMDRecycle.RecycleFB, new Output());
            ModelProxy.change("data", "recycle", 1);
            return;
        }// end function

        protected function clearZb(event:MouseEvent) : void
        {
            PluginManager.instance.sendToBufferServer("zbhsy", CMDRecycle.RecycleAll, new Output());
            ModelProxy.change("data", "recycle", 1);
            var _loc_2:* = UserData.getData(UserDataType.Task);
            return;
        }// end function

        protected function rollover(event:MouseEvent) : void
        {
            var _loc_6:Object = null;
            var _loc_7:Object = null;
            var _loc_8:int = 0;
            var _loc_2:Number = 0;
            var _loc_3:int = 0;
            var _loc_4:int = 0;
            var _loc_5:* = event.currentTarget as LinkButton;
            switch(_loc_5)
            {
                case zbtxt:
                {
                    if (this.allarr)
                    {
                        for each (_loc_6 in this.allarr)
                        {
                            
                            _loc_7 = this._cfgRecycle[_loc_6[4].itemid];
                            if (_loc_7)
                            {
                                _loc_2 = _loc_2 + int(_loc_7.exp);
                                _loc_3 = _loc_3 + int(_loc_7.bgold);
                            }
                        }
                    }
                    break;
                }
                case kstxt:
                {
                    if (this.ksarr)
                    {
                        _loc_4 = 0;
                        while (_loc_4 < this.ksarr.length)
                        {
                            
                            _loc_8 = ItemUilt.getAllCount(this.ksarr[_loc_4].itemid);
                            _loc_2 = _loc_2 + int(this.ksarr[_loc_4].exp * _loc_8);
                            _loc_3 = _loc_3 + int(this.ksarr[_loc_4].bgold * _loc_8);
                            _loc_4++;
                        }
                    }
                    break;
                }
                case fbzbtxt:
                {
                    if (this.fbzyarr)
                    {
                        _loc_4 = 0;
                        while (_loc_4 < this.fbzyarr.length)
                        {
                            
                            _loc_2 = _loc_2 + int(this.fbzyarr[_loc_4].exp);
                            _loc_3 = _loc_3 + int(this.fbzyarr[_loc_4].bgold);
                            _loc_4++;
                        }
                    }
                    break;
                }
                case fszhuan1:
                {
                    if (this.fszb1)
                    {
                        _loc_4 = 0;
                        while (_loc_4 < this.fszb1.length)
                        {
                            
                            _loc_2 = _loc_2 + int(this.fszb1[_loc_4].exp);
                            _loc_3 = _loc_3 + int(this.fszb1[_loc_4].bgold);
                            _loc_4++;
                        }
                    }
                    break;
                }
                case zszhuan1:
                {
                    if (this.zszb1)
                    {
                        _loc_4 = 0;
                        while (_loc_4 < this.zszb1.length)
                        {
                            
                            _loc_2 = _loc_2 + int(this.zszb1[_loc_4].exp);
                            _loc_3 = _loc_3 + int(this.zszb1[_loc_4].bgold);
                            _loc_4++;
                        }
                    }
                    break;
                }
                case dszhuan1:
                {
                    if (this.dszb1)
                    {
                        _loc_4 = 0;
                        while (_loc_4 < this.dszb1.length)
                        {
                            
                            _loc_2 = _loc_2 + int(this.dszb1[_loc_4].exp);
                            _loc_3 = _loc_3 + int(this.dszb1[_loc_4].bgold);
                            _loc_4++;
                        }
                    }
                    break;
                }
                default:
                {
                    break;
                }
            }
            ModelProxy.change("tips", "normal", "人物经验:" + _loc_2 + "\n" + "绑定金币:" + _loc_3);
            return;
        }// end function

        protected function rollout(event:MouseEvent) : void
        {
            ModelProxy.change("tips", "state", "close");
            return;
        }// end function

        private function listener() : void
        {
            return;
        }// end function

        private function clearFS(param1:int) : void
        {
            if (param1 < 0)
            {
                return;
            }
            var _loc_2:* = new Output();
            if (param1 > 0)
            {
                _loc_2.writeVarInt(this.djarr[param1], false);
                _loc_2.writeVarInt(this.djarr[param1], false);
            }
            else
            {
                _loc_2.writeVarInt(1, false);
                _loc_2.writeVarInt((this.djarr[param1] - 1), false);
            }
            _loc_2.writeVarInt(2, false);
            _loc_2.writeVarInt(0, false);
            PluginManager.instance.sendToBufferServer("zbhsy", CMDRecycle.RecycleEquip, _loc_2);
            ModelProxy.change("data", "recycle", 1);
            return;
        }// end function

        private function clearDS(param1:int) : void
        {
            if (param1 < 0)
            {
                return;
            }
            var _loc_2:* = new Output();
            if (param1 > 0)
            {
                _loc_2.writeVarInt(this.djarr[param1], false);
                _loc_2.writeVarInt(this.djarr[param1], false);
            }
            else
            {
                _loc_2.writeVarInt(1, false);
                _loc_2.writeVarInt((this.djarr[param1] - 1), false);
            }
            _loc_2.writeVarInt(3, false);
            _loc_2.writeVarInt(0, false);
            PluginManager.instance.sendToBufferServer("zbhsy", CMDRecycle.RecycleEquip, _loc_2);
            ModelProxy.change("data", "recycle", 1);
            return;
        }// end function

        private function clearZS(param1:int) : void
        {
            if (param1 < 0)
            {
                return;
            }
            var _loc_2:* = new Output();
            if (param1 > 0)
            {
                _loc_2.writeVarInt(this.djarr[param1], false);
                _loc_2.writeVarInt(this.djarr[param1], false);
            }
            else
            {
                _loc_2.writeVarInt(1, false);
                _loc_2.writeVarInt((this.djarr[param1] - 1), false);
            }
            _loc_2.writeVarInt(1, false);
            _loc_2.writeVarInt(0, false);
            PluginManager.instance.sendToBufferServer("zbhsy", CMDRecycle.RecycleEquip, _loc_2);
            ModelProxy.change("data", "recycle", 1);
            return;
        }// end function

        private function dslistHandler(param1:Component, param2:int) : void
        {
            var _loc_3:int = 0;
            var _loc_4:int = 0;
            var _loc_5:int = 0;
            var _loc_6:Object = null;
            var _loc_7:Object = null;
            var _loc_8:LinkButton = null;
            if (param2 < dslist.array.length)
            {
                _loc_3 = 0;
                _loc_4 = 0;
                _loc_5 = 0;
                for each (_loc_7 in this.dsitem)
                {
                    
                    if (param2 == 0)
                    {
                        if (_loc_7[4] && _loc_7[4].level < this.djarr[param2])
                        {
                            _loc_6 = this._cfgRecycle[_loc_7[4].itemid];
                            if (_loc_6)
                            {
                                _loc_4 = _loc_4 + int(_loc_6.exp);
                                _loc_5 = _loc_5 + int(_loc_6.bgold);
                                _loc_3++;
                            }
                        }
                        continue;
                    }
                    if (_loc_7[4] && _loc_7[4].level == this.djarr[param2])
                    {
                        _loc_6 = this._cfgRecycle[_loc_7[4].itemid];
                        if (_loc_6)
                        {
                            _loc_4 = _loc_4 + int(_loc_6.exp);
                            _loc_5 = _loc_5 + int(_loc_6.bgold);
                            _loc_3++;
                        }
                    }
                }
                _loc_8 = param1.getChildByName("label") as LinkButton;
                if (_loc_3 <= 0)
                {
                    _loc_8.labelColors = "0x766b62";
                    param1.mouseEnabled = false;
                    param1.mouseChildren = false;
                }
                else
                {
                    _loc_8.labelColors = "0x54B436,0xefd742,0x54b436,0xefd742";
                    param1.mouseEnabled = true;
                    param1.mouseChildren = true;
                    if (param1.hasEventListener(MouseEvent.ROLL_OVER))
                    {
                        param1.removeEventListener(MouseEvent.ROLL_OUT, this.rollout);
                        param1.removeEventListener(MouseEvent.ROLL_OVER, this.daoshiitemTips);
                    }
                    param1.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
                    param1.addEventListener(MouseEvent.ROLL_OVER, this.daoshiitemTips);
                }
                _loc_8.label = StringUtil.substitute(this.txtarr[param2], _loc_3);
            }
            return;
        }// end function

        private function daoshiitemTips(event:MouseEvent) : void
        {
            var _loc_2:Object = null;
            var _loc_7:Object = null;
            var _loc_3:* = event.currentTarget as Component;
            var _loc_4:int = 0;
            var _loc_5:int = 0;
            var _loc_6:* = dslist.cells.indexOf(_loc_3 as Box);
            for each (_loc_7 in this.dsitem)
            {
                
                if (_loc_6 == 0)
                {
                    if (_loc_7[4] && _loc_7[4].level < this.djarr[_loc_6])
                    {
                        _loc_2 = this._cfgRecycle[_loc_7[4].itemid];
                        if (_loc_2)
                        {
                            _loc_4 = _loc_4 + int(_loc_2.exp);
                            _loc_5 = _loc_5 + int(_loc_2.bgold);
                        }
                    }
                    continue;
                }
                if (_loc_7[4] && _loc_7[4].level == this.djarr[_loc_6])
                {
                    _loc_2 = this._cfgRecycle[_loc_7[4].itemid];
                    if (_loc_2)
                    {
                        _loc_4 = _loc_4 + int(_loc_2.exp);
                        _loc_5 = _loc_5 + int(_loc_2.bgold);
                    }
                }
            }
            ModelProxy.change("tips", "normal", "人物经验:" + _loc_4 + "\n" + "绑定金币:" + _loc_5);
            return;
        }// end function

        private function fslistHandler(param1:Component, param2:int) : void
        {
            var _loc_3:int = 0;
            var _loc_4:int = 0;
            var _loc_5:int = 0;
            var _loc_6:Object = null;
            var _loc_7:Object = null;
            var _loc_8:LinkButton = null;
            if (param2 < fslist.array.length)
            {
                _loc_3 = 0;
                _loc_4 = 0;
                _loc_5 = 0;
                for each (_loc_7 in this.fsitem)
                {
                    
                    if (param2 == 0)
                    {
                        if (_loc_7[4] && _loc_7[4].level < this.djarr[param2])
                        {
                            _loc_6 = this._cfgRecycle[_loc_7[4].itemid];
                            if (_loc_6)
                            {
                                _loc_4 = _loc_4 + int(_loc_6.exp);
                                _loc_5 = _loc_5 + int(_loc_6.bgold);
                            }
                            _loc_3++;
                        }
                        continue;
                    }
                    if (_loc_7[4] && _loc_7[4].level == this.djarr[param2])
                    {
                        _loc_6 = this._cfgRecycle[_loc_7[4].itemid];
                        if (_loc_6)
                        {
                            _loc_4 = _loc_4 + int(_loc_6.exp);
                            _loc_5 = _loc_5 + int(_loc_6.bgold);
                        }
                        _loc_3++;
                    }
                }
                _loc_8 = param1.getChildByName("label") as LinkButton;
                if (_loc_3 <= 0)
                {
                    _loc_8.labelColors = "0x766b62";
                    param1.mouseEnabled = false;
                    param1.mouseChildren = false;
                }
                else
                {
                    _loc_8.labelColors = "0x54B436,0xefd742,0x54b436,0xefd742";
                    param1.mouseEnabled = true;
                    param1.mouseChildren = true;
                    if (param1.hasEventListener(MouseEvent.ROLL_OVER))
                    {
                        param1.removeEventListener(MouseEvent.ROLL_OUT, this.rollout);
                        param1.removeEventListener(MouseEvent.ROLL_OVER, this.fashiitemTips);
                    }
                    param1.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
                    param1.addEventListener(MouseEvent.ROLL_OVER, this.fashiitemTips);
                }
                _loc_8.label = StringUtil.substitute(this.txtarr[param2], _loc_3);
            }
            return;
        }// end function

        private function fashiitemTips(event:MouseEvent) : void
        {
            var _loc_5:Object = null;
            var _loc_7:Object = null;
            var _loc_2:* = event.currentTarget as Component;
            var _loc_3:int = 0;
            var _loc_4:int = 0;
            var _loc_6:* = fslist.array.indexOf(_loc_2.dataSource);
            for each (_loc_7 in this.fsitem)
            {
                
                if (_loc_6 == 0)
                {
                    if (_loc_7[4] && _loc_7[4].level < this.djarr[_loc_6])
                    {
                        _loc_5 = this._cfgRecycle[_loc_7[4].itemid];
                        if (_loc_5)
                        {
                            _loc_3 = _loc_3 + int(_loc_5.exp);
                            _loc_4 = _loc_4 + int(_loc_5.bgold);
                        }
                    }
                    continue;
                }
                if (_loc_7[4] && _loc_7[4].level == this.djarr[_loc_6])
                {
                    _loc_5 = this._cfgRecycle[_loc_7[4].itemid];
                    if (_loc_5)
                    {
                        _loc_3 = _loc_3 + int(_loc_5.exp);
                        _loc_4 = _loc_4 + int(_loc_5.bgold);
                    }
                }
            }
            ModelProxy.change("tips", "normal", "人物经验:" + _loc_3 + "\n" + "绑定金币:" + _loc_4);
            return;
        }// end function

        private function zslistHandler(param1:Component, param2:int) : void
        {
            var _loc_3:int = 0;
            var _loc_4:int = 0;
            var _loc_5:int = 0;
            var _loc_6:Object = null;
            var _loc_7:Object = null;
            var _loc_8:LinkButton = null;
            if (param2 < zslist.array.length)
            {
                _loc_3 = 0;
                _loc_4 = 0;
                _loc_5 = 0;
                for each (_loc_7 in this.zsitem)
                {
                    
                    if (param2 == 0)
                    {
                        if (_loc_7[4] && _loc_7[4].level < this.djarr[param2])
                        {
                            _loc_6 = this._cfgRecycle[_loc_7[4].itemid];
                            if (_loc_6)
                            {
                                _loc_4 = _loc_4 + int(_loc_6.exp);
                                _loc_5 = _loc_5 + int(_loc_6.bgold);
                            }
                            _loc_3++;
                        }
                        continue;
                    }
                    if (_loc_7[4] && _loc_7[4].level == this.djarr[param2])
                    {
                        _loc_6 = this._cfgRecycle[_loc_7[4].itemid];
                        if (_loc_6)
                        {
                            _loc_4 = _loc_4 + int(_loc_6.exp);
                            _loc_5 = _loc_5 + int(_loc_6.bgold);
                        }
                        _loc_3++;
                    }
                }
                _loc_8 = param1.getChildByName("label") as LinkButton;
                if (_loc_3 <= 0)
                {
                    _loc_8.labelColors = "0x766b62";
                    param1.mouseEnabled = false;
                    param1.mouseChildren = false;
                }
                else
                {
                    _loc_8.labelColors = "0x54B436,0xefd742,0x54b436,0xefd742";
                    param1.mouseEnabled = true;
                    param1.mouseChildren = true;
                    if (param1.hasEventListener(MouseEvent.ROLL_OVER))
                    {
                        param1.removeEventListener(MouseEvent.ROLL_OUT, this.rollout);
                        param1.removeEventListener(MouseEvent.ROLL_OVER, this.zhanshiitemTips);
                    }
                    param1.addEventListener(MouseEvent.ROLL_OUT, this.rollout);
                    param1.addEventListener(MouseEvent.ROLL_OVER, this.zhanshiitemTips);
                }
                _loc_8.label = StringUtil.substitute(this.txtarr[param2], _loc_3);
            }
            return;
        }// end function

        private function zhanshiitemTips(event:MouseEvent) : void
        {
            var _loc_5:Object = null;
            var _loc_7:Object = null;
            var _loc_2:* = event.currentTarget as Component;
            var _loc_3:int = 0;
            var _loc_4:int = 0;
            var _loc_6:* = zslist.array.indexOf(_loc_2.dataSource);
            for each (_loc_7 in this.zsitem)
            {
                
                if (_loc_6 == 0)
                {
                    if (_loc_7[4] && _loc_7[4].level < this.djarr[_loc_6])
                    {
                        _loc_5 = this._cfgRecycle[_loc_7[4].itemid];
                        if (_loc_5)
                        {
                            _loc_3 = _loc_3 + int(_loc_5.exp);
                            _loc_4 = _loc_4 + int(_loc_5.bgold);
                        }
                    }
                    continue;
                }
                if (_loc_7[4] && _loc_7[4].level == this.djarr[_loc_6])
                {
                    _loc_5 = this._cfgRecycle[_loc_7[4].itemid];
                    if (_loc_5)
                    {
                        _loc_3 = _loc_3 + int(_loc_5.exp);
                        _loc_4 = _loc_4 + int(_loc_5.bgold);
                    }
                }
            }
            ModelProxy.change("tips", "normal", "人物经验:" + _loc_3 + "\n" + "绑定金币:" + _loc_4);
            return;
        }// end function

    }
}
